<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" th:href="@{/css/login.css}"/>
    <script th:src="@{/js/jquery-1.9.1.min.js}" type="text/javascript" charset="utf-8"></script>
    <link th:href="@{/css/bootstrap.min.css}">
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/js/jquery-2.1.0.min.js}"></script>

    <style>
        #img {
            height: 35px;
        }
        #wr{
            text-align: center;
            padding: 20px;
        }
    </style>
    <script>
        function replaceVerificationCode() {
            //获取图片对象
            let id = document.getElementById("img");
            //更换验证码
            id.src = "http://localhost:8080/verificationCode?time=" + new Date().getTime();
        }
    </script>
</head>
<body>
<div class="login">
    <div class="content clearfix">
        <div class="content-left">
            <div class="logo">
                <img th:src="@{/images/logo.png}" alt=""/>
                <p>南昌大学学生管理系统</p>
            </div>
        </div>
        <form method="post" th:action="@{/checkLoginIfSuccessful}">
            <div class="shu"></div>
            <div class="content-right">
                <div class="login-form">
                    <h2>用户登录/LOGIN</h2>

                    <div class="account clearfix">
                        <span>账　号：</span>
                        <input type="text" name="username" placeholder="请输入账号"/>
                    </div>
                    <div class="password clearfix">
                        <span>密　码：</span>
                        <input type="password" name="password" placeholder="请输入密码"/>
                    </div>
                    <div class="code clearfix">
                        <span>验证码：</span>
                        <input type="text" name="verificationCode" placeholder="请输入验证码"/>
                        <img id="img" onclick="replaceVerificationCode()" th:src="@{/verificationCode}"></img>
                    </div>
                    <div class="btn">
                        <input type="submit" id="login" value="登录"/>
                    </div>
                </div>

                <th:block th:if="${msg}!=null">
                    <!-- 出错显示的信息框 -->
                    <div class="code clearfix" id="wr">
                        <span><strong th:text="${msg}" style="color: red"></strong></span>
                    </div>
                </th:block>

            </div>
        </form>
    </div>
</div>
</body>
</html>
